﻿/// <reference path="/Scripts/jquery-1.5.1.min.js">
/// <reference path="/Scripts/jquery.validate.js">
/// <reference path="/Scripts/jquery.validate.unobtrusive.js">

$.validator.unobtrusive.adapters.addSingleVal("validatefileformat", "fileformat");
$.validator.addMethod("validatefileformat", function (value, element, format) {
    if (value) {
        var s = "";
        var arr = value.split('.');
        var filef = arr[arr.length - 1];
        if (format.toLowerCase().indexOf(filef.toLowerCase()) < 0) {
            return false;
        }
    }
    return true;
})

